package com.htt.bms.domain.sys;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 侯婷婷
 * @version 1.0
 * @description 组织
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName(value = "sys_org")
@ApiModel("组织")
public class SysOrg {

    @ApiModelProperty("主键id")
    @TableId(type = IdType.AUTO)
    private Integer id;//主键id

    @ApiModelProperty("组织名称")
    private String name;//组织名称

    @ApiModelProperty("父id")
    private Integer parentId;//父id

    @ApiModelProperty("排序")
    private Integer sort;//排序

    @ApiModelProperty("删除状态：0.正常,1.已删除")
    private Integer delFlag;//删除状态： 0.正常，1.已删除

    @ApiModelProperty("删除状态")
    @TableField(exist = false)
    private String delFlagName;//删除状态

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    private LocalDateTime updateTime;//更新时间

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    private LocalDateTime createTime;//创建时间

    @ApiModelProperty("子集")
    @TableField(exist = false)
    private List<SysOrg> children;//子集

    @ApiModelProperty("用户id")
    @TableField(exist = false)
    private String userId;//用户Id
}
